//
//  LJHBaseTableViewCell.m
//  HEARME
//
//  Created by 曲政永 on 16/1/21.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LJHBaseTableViewCell.h"

@implementation LJHBaseTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = [UIColor whiteColor];
        self.textLabel.textColor = [UIColor lightGrayColor];
        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"]) {
            self.backgroundColor = [UIColor lightGrayColor];
            self.textLabel.textColor = [UIColor whiteColor];
        }
        
    }
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"changeColor" object:nil];
    return self;
}
-(void)dealloc
{
    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"changeColor" object:nil];
    [super dealloc];
}

-(void)changeColor:(NSNotification *)notifition
{
    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"])
    {
        self.backgroundColor = [UIColor lightGrayColor];
        self.textLabel.textColor = [UIColor whiteColor];
        
    }
    else
    {
        self.backgroundColor = [UIColor whiteColor];
        self.textLabel.textColor = [UIColor lightGrayColor];
        
    }
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
